package servlet;/*
 * @Author: Tiangle
 * @Date:   {DATE}
 * @TIME:   {TIME}
 * @Project_Name: {PROJECT_NAME}
 * @Package_Name: {PACKAGE_NAME}
 */

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class CookieServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Cookie cookie = new Cookie("name", "tom");
        //将cookie
        resp.addCookie(cookie);
    }
}
